package cn.lee.test.AuthFilter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author : lichl(李承霖)
 * create: 2022/2/23 20:10 周三
 * intro: 设置拦截器拦截哪些接口
 */

@Configuration
public class InterceptApiConfigurer implements WebMvcConfigurer{
  
  @Autowired
  private JwtIntercept jwtIntercept;
  
  
  @Override
  public void addInterceptors(InterceptorRegistry registry){
    registry.addInterceptor(jwtIntercept)
      .addPathPatterns("/api/**")
      .excludePathPatterns("/api/login/**");
//      .excludePathPatterns("/api/===="); 可以无限加
  }
}
